package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        String name = main.getName();
        System.out.println("主线程的名字：" + name);
        long id = main.getId();
        System.out.println("唯一标识：" +id);
        int priority = main.getPriority();// 默认为5
        System.out.println("线程优先级：" + priority);
        boolean alive = main.isAlive();
        System.out.println("是否活着：" + alive);
        boolean daemon = main.isDaemon();
        System.out.println("是否为守护线程：" + daemon);
        boolean interrupted = main.isInterrupted();
        System.out.println("是否中断：" + interrupted);

    }
}
